import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import { handleApiError } from './utils/error-handler'

const app = createApp(App)

// 全局错误处理
app.config.errorHandler = (err) => {
    console.error(err)
    handleApiError(err)
  }

app.use(router)
app.use(createPinia())
app.use(ElementPlus)
app.mount('#app')
